package com.chance.cc.crawler.prod.command.trigger.domain.news.toutiao;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.news.toutiao.TTCommonScript;
import com.chance.cc.crawler.prod.command.job.domain.news.toutiao.realtime.TTBKRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.toutiao.realtime.TTRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.toutiao.trace.TTBKCommentTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.toutiao.trace.TTBKTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.toutiao.trace.TTCommentTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.toutiao.trace.TTTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author lt
 * @version 1.0
 * @date 2021-04-12 16:44:53
 * @email okprog@sina.com
 */
public class TTCommonCrawlerSchedulerTrigger extends CommonCrawlerSchedulerTrigger {


    public static void main(String[] args) {
//        publishTTRealtimeScheduleTriggerInfo();
//
        publishTTTraceScheduleTriggerInfo();
//
//        publishTTCommentTraceScheduleTriggerInfo();
//
//        //bk
//        publishTTBKRealtimeScheduleTriggerInfo();
//
        publishTTBKTraceScheduleTriggerInfo();
//
//        publishTTBKCommentTraceScheduleTriggerInfo();
    }

    public static void publishTTRealtimeScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TTRealtimeCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TTCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/20 * * * ?",
                "今日头条实时采集任务，每二十分钟采集一次");
    }

    public static void publishTTTraceScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TTTraceCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TTCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 30 0 * * ?",
                "今日头条追溯7日评论采集任务，每天采集一次");
    }

    public static void publishTTCommentTraceScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TTCommentTraceCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TTCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 * * * ?",
                "今日头条追溯当日评论采集任务，每小时采集一次");
    }

    public static void publishTTBKRealtimeScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TTBKRealtimeCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TTCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/10 * * * ?",
                "今日头条板块实时采集任务，每十分钟采集一次");
    }

    public static void publishTTBKTraceScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TTBKTraceCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TTCommonScript.domain,
//                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 46 0 * * ?",
//                "",
                "今日头条板块追溯7日评论采集任务，每天采集一次");
    }

    public static void publishTTBKCommentTraceScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TTBKCommentTraceCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TTCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 * * * ?",
                "今日头条板块追溯当日评论采集任务，每小时采集一次");
    }
}
